<template>
  <div
    class="Item"
    :style="{
      background: bg ? `url(${bg}) no-repeat center` : '#fff',
    }"
    :class="{
      firstClass: order === 1,
      middleClass: order > 1 && order <= rightMenuOrder,
      lastClass: order > rightMenuOrder,
    }"
  >
    <router-link :to="typeof path === 'object' ? path : { path }">
      <slot name="title"></slot>
    </router-link>
  </div>
</template>
<script setup>
import { reactive, watch, computed, ref } from 'vue';
defineProps({
  path: {
    type: String || Object,
    default: () => '',
  },
  bg: {
    type: String,
    default: () => '',
  },
  order: {
    type: Number,
    default: 0,
  },
  rightMenuOrder: {
    type: Number,
    default: 2,
  },
});
</script>
<style lang="scss" scoped>
@import './menu.scss';
.Item {
  border: 1px solid #fbc73a;
  height: 40px;
  line-height: 36px;
  border: 2px solid #fbc73a;
  padding: 0 18px 0 8px;
  margin-top: 2px;
  border-radius: 5px;
  box-sizing: border-box;
  // border-bottom: none;
  font-size: 14px;
  color: #fff;
  background-size: 100% 100% !important;
  @include title; //混合title subItem和Item
  @include a; //混合a subItem和Item
  .router-link-active {
    color: #fbc73a;
  }
}
</style>
